package com.byq.mm.smartlib.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.byq.mm.smartlib.R;

public class AddFriendRequestActivity  extends AbstractSmartActivity {
	String jid;
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.addfriend_request);
   jid = this.getIntent().getExtras().getString("userName");
    TextView name = (TextView)this.findViewById(R.id.userName);
    name.setText(jid.split("@")[0]);
    
    Button accept = (Button)this.findViewById(R.id.accept);

    Button refuse = (Button)this.findViewById(R.id.refuse);
  
    accept.setOnClickListener(new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			application.getAndroidSmartEngine().getXmppEngine().getContactManager().agree(jid);
			finish();
		}
	});
    refuse.setOnClickListener(new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			
			finish();			
		}
	});
 
  
  }
}
